﻿using IntelligentAgriculture.Contracts.Interface;
using IntelligentAgriculture.WebAPI.Application.Command.LambweaninginfoCommand;
using MediatR;

namespace IntelligentAgriculture.WebAPI.Application.CommandHandler.LambweaninginfoCommandHandler
{
	/// <summary>
	/// 羊羔断奶删除
	/// </summary>
	/// <param name="ids"></param>
	/// <returns></returns>
	public class DelLambweaninginfosCommandHandler : IRequestHandler<DelLambweaninginfosCommand, Results<int>>
	{
		/// <summary>
		/// 接口
		/// </summary>
		private readonly ILambweaninginfoService _lambweaninginfoService;
		/// <summary>
		/// 构造函数
		/// </summary>
		/// <param name="lambweaninginfoService"></param>

		public DelLambweaninginfosCommandHandler(ILambweaninginfoService lambweaninginfoService)
		{
			_lambweaninginfoService = lambweaninginfoService;
		}
		/// <summary>
		/// 羊羔断奶删除
		/// </summary>
		/// <returns></returns>
		public async Task<Results<int>> Handle(DelLambweaninginfosCommand request, CancellationToken cancellationToken)
		{
			var result = await _lambweaninginfoService.DelLambweaninginfos(request.eartags);
			return Results<int>.DataResult(result);
		}
	}
}
